<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        /* div {
            width: 400px;
            height: 120px;
            margin-top: 50px;
            border: 2px solid gray;
            padding: 10px;
        } */
        div {
            width: 200px;
            height: 200px;
            line-height: 200px;
            border: 2px solid gray;
            text-align: center;
            color: red;
        }
    </style>
</head>

<body>
    <!-- <input type="button" value="删除">
    <input type="button" value="取消删除">
    <div>点击"删除"按钮后，里面的内容将在3秒钟后消失；<br /><br />如点击了"删除"后又不想删除内容，请在点击"删除"按钮3秒之内点击"取消删除"按钮即可</div> -->
    <h3>会闪烁的文字</h3>
    <div id="text"> </div>

    <script type="text/javascript">
        //补充代码
        // var btn1 = document.getElementsByTagName("input")[0];
        // var btn2 = document.getElementsByTagName("input")[1];
        // var div = document.getElementsByTagName("div")[0];
        // btn1.onclick = function () {
        //     delId = setTimeout(() => {
        //         div.innerHTML = "";
        //     }, 3000);
        // }
        // btn2.onclick = function () {
        //     clearTimeout(delId);
        // }
        var text = document.getElementById("text");
        var a = 0;
        setInterval(() => {
            if (a == 0) {
                a = 1;
                text.innerHTML = "☆☆☆今日特卖☆☆☆";
            } else {
                a = 0;
                text.innerHTML = "★★★今日特卖★★★";
            }
        }, 500);
    </script>
</body>

</html>